package com.system.service.impl;

import com.system.mapper.PlanMapper;
import com.system.po.Plan;
import com.system.service.PlanService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class PlanServiceImpl implements PlanService {
    @Autowired
    private PlanMapper planMapper;

    @Override
    public List<Plan> selectPlanList() {

        return planMapper.selectPlanList();
    }

    @Override
    public Plan selectPlanByPlanId(Integer id) {
        return planMapper.selectPlanByPlanId(id);
    }

    @Override
    public Boolean updatePlanByPlanId(Plan plan) {
        return planMapper.updatePlanByPlanId(plan);
    }

    @Override
    public Boolean addPlan(Plan plan) {
        System.out.println("添加-----------plan");
        System.out.println(plan.toString());
        System.out.println("添加-----------plan");
        return planMapper.addPlan(plan);
    }

    @Override
    public Plan addPlanAndReturnPlanId(Plan plan) {
        return planMapper.addPlanAndReturnPlanId(plan);
    }

    @Override
    public Boolean deletePlanById(Integer id) {
        return planMapper.deletePlanById(id);
    }

    @Override
    public List<Plan> selectPlanListChildrenByParentId(Integer id) {
        return planMapper.selectPlanListChildrenByParentId(id);
    }


}
